package com.whzykj.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;
import com.whzykj.jfinal.TableBind;

@TableBind(name="dictionary",pk="id")
public class Dictionary extends Model<Dictionary> {
	private static final long serialVersionUID = 1L;
	public static final Dictionary me=new Dictionary();
	
	/***
	 * 数据缓存加载所有数据字典信息
	 * 09.10
	 * @author yuandj
	 * @return
	 */
	public List<Dictionary> loadDicCache() {
		StringBuffer sbf = new StringBuffer();
		sbf.append(" select *  ");
		sbf.append(" from Dictionary ");
		return Dictionary.me.find(sbf.toString());
	}
	
	public List<Dictionary> getDic(String type) {
		StringBuffer sbf = new StringBuffer(200);
		sbf.append("select * ");
		sbf.append(" from Dictionary where dict_type='").append(type).append("' order by id ");
		return Dictionary.me.find(sbf.toString());
	}
}
